Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(root): a slightly more concise definition borrowed from Angular #2593

Merged
merged 2 commits into from
May 9, 2017
Merged

refactor(root): a slightly more concise definition borrowed from Angular #2593

merged 2 commits into from
May 9, 2017

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented May 5, 2017

Description:

Related issue (if exists):

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 97.703% when pulling 67a8354 on benlesh:smaller_root into ebf6393 on ReactiveX:master.

Copy link
Member

@kwonoj kwonoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we're not throwing anymore if root is not resolvable?

@benlesh
Copy link
Member Author

benlesh commented May 5, 2017

so we're not throwing anymore if root is not resolvable?

I'm not sure there is a situation where root isn't resolvable, honestly. That was just some defensive coding. I'm indifferent, I'll leave it to the community.

@kwonoj
Copy link
Member

kwonoj commented May 5, 2017

I wouldn't expect this occurs in usual cases, but there were few exceptional cases patching globals around could be caught by thrown exception. So for me it's good to have, it allowed us to identify some unexpected behavior comes from it.

src/util/root.ts Outdated
const _root: any = __window || __global || __self;

if (!_root) {
throw new Error('No window, global or root reference found');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess throw should be wrapped in IIFE as previous for closure compiler compatibility?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.. changed it to match what used to be there exactly.

Copy link
Member

@kwonoj kwonoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@benlesh benlesh merged commit 3066c78 into ReactiveX:master May 9, 2017
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants